![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
cl-component-translate
Advanced tools
CrowdLab Translate Component
Components for translating text, numbers, dates and times.
$ yarn add cl-component-translate
Wraps the tree to provide the context for translations, wrapper for react-intl's IntlProvider
Usage:
import { TranslationProvider } from 'crowdlab-react-translations';
const locale = {
tag: 'en',
language: 'en-GB',
translations: {
test: 'translated'
}
};
<TranslationProvider locale={locale}>
<div>Children</div>
</TranslationProvider>
Wrapper for react-intl's FormattedMessage, does the nuts and bolts of the translating.
Usage:
import { Translate } from 'crowdlab-react-translations';
<Translate id="key.to.translate" />
Wrapper for react-intl's FormattedNumber
Usage:
import { Number } from 'crowdlab-react-translations';
<Number number="5" style="percent" />
Relative data formatting, ie. 5 minutes ago, In 4 years time etc.
Usage:
import { RelativeDate } from 'crowdlab-react-translations';
<RelativeDate date="1989-10-28T18:08:40+00:00" />
Timestamp date time formatting. ie: October 28, 1989, 4:25 PM
Usage:
import { Timestamp } from 'crowdlab-react-translations';
<Timestamp date="1989-10-28T18:08:40+00:00" />
Wrapper for react-intl's injectIntl, provides a translate() method to wrapper component The translate() method works much the same as the Translate component
Usage:
import { injectTranslationHelpers } from 'crowdlab-react-translations';
const Component = (translate) => {
const translatedThing = translate({ id: 'test.key' });
return <div data-t={translatedThing} />;
}
export default injectTranslationHelpers()(Component);
This is used for testing react components that need access to Translate. Because translate needs context to offer translations. This uses the default translations but you can pass custom translations as an additional argument.
Usage:
import { injectTranslations } from 'crowdlab-react-translations';
test('something is translated', (t) => {
const translations = {
test: 'translated text'
};
const wrapper = mount(injectTranslations(<Component />, translations));
t.is(wrapper.text(), 'translated text');
})
FAQs
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
We found that cl-component-translate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.